﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Lotus.Domain.Input
{
    /// <summary>
    /// 项目过程文件_发起输入对象
    /// </summary>
    public class StartLotusWorkflowInput
    {
        /// <summary>
        /// 流程定义Key
        /// </summary>
        [JsonProperty("defKey")]
        public string DefKey { get; set; }

        /// <summary>
        /// 动作 发起时固定值start，作废终止时，传入manualEnd
        /// </summary>
        [JsonProperty("action")]
        public string Action { get; set; }

        /// <summary>
        /// 发起人工号
        /// </summary>
        [JsonProperty("applicant")]
        public string? Applicant { get; set; }

        /// <summary>
        /// 业务唯一ID，用于跳转外部系统时使用
        /// </summary>
        [JsonProperty("businessId")]
        public string BusinessId { get; set; }

        /// <summary>
        /// 流程重新发起时必需要传原流程实例编号
        /// </summary>
        [JsonProperty("instanceId")]
        public string? InstanceId { get; set; }

        /// <summary>
        /// 流程业务数据，结构根据各业务的表单实体表不同而改变
        /// </summary>
        [JsonProperty("data")]
        public StartLotusWorkflowData Data { get; set; }
    }

    /// <summary>
    /// 流程业务数据
    /// </summary>
    public class StartLotusWorkflowData
    {
        /// <summary>
        /// 对象属性
        /// </summary>
        [JsonProperty("lotus_process_file_entity")]
        public StartLotusWorkflowFileEntity LotusProcessFileEntity { get; set; }
    }

    /// <summary>
    /// 对象属性
    /// </summary>
    public class StartLotusWorkflowFileEntity
    {
        /// <summary>
        /// 外围系统发起标识
        /// </summary>
        [JsonProperty("edisSign")]
        public string EdisSign { get; set; }

        /// <summary>
        /// 如果流程重新发起，需要提供实体表主键
        /// </summary>
        [JsonProperty("id")]
        public string? Id { get; set; }

        /// <summary>
        /// 流程标题(选项key以"-"分隔开):项目组（平台）-车型/项目/产品-文件层级-子类别前缀补充-子类别名称-文件签审类型
        /// </summary>
        [JsonProperty("processTitle")]
        public string ProcessTitle { get; set; }

        /// <summary>
        /// 文件签审类型-发布(1)-变更(2)-补充(3)-作废(4)
        /// </summary>
        [JsonProperty("documentRelseaseType")]
        public string? DocumentRelseaseType { get; set; }

        /// <summary>
        /// 原文件编号
        /// </summary>
        [JsonProperty("oldDocumentNO")]
        public string OldDocumentNO { get; set; }

        /// <summary>
        /// 项目组(平台)
        /// </summary>
        [JsonProperty("projectGroup")]
        public string? ProjectGroup { get; set; }

        /// <summary>
        /// 车型/项目/产品
        /// </summary>
        [JsonProperty("modelProject")]
        public string ModelProject { get; set; }

        /// <summary>
        /// 阶段
        /// </summary>
        [JsonProperty("stage")]
        public string? Stage { get; set; }

        /// <summary>
        /// 关键节点
        /// </summary>
        [JsonProperty("node")]
        public string Node { get; set; }

        /// <summary>
        /// 文件层级
        /// </summary>
        [JsonProperty("fileLevel")]
        public string? FileLevel { get; set; }

        /// <summary>
        /// 类别
        /// </summary>
        [JsonProperty("classes")]
        public string? Classes { get; set; }

        /// <summary>
        /// 子类别
        /// </summary>
        [JsonProperty("subclass")]
        public string? Subclass { get; set; }

        /// <summary>
        /// 子类别前缀补充
        /// </summary>
        [JsonProperty("subclassPrefix")]
        public string? SubclassPrefix { get; set; }

        /// <summary>
        /// PSS
        /// </summary>
        [JsonProperty("pss")]
        public string? Pss { get; set; }

        /// <summary>
        /// 涉及零件号
        /// </summary>
        [JsonProperty("partNumber")]
        public string? PartNumber { get; set; }

        /// <summary>
        /// 所属模块
        /// </summary>
        [JsonProperty("businessModule")]
        public string BusinessModule { get; set; }

        /// <summary>
        /// 文件密级-一般(1)-秘密(2)-机密(3)-绝密(4)
        /// </summary>
        [JsonProperty("fileConfidentiality")]
        public string? FileConfidentiality { get; set; }

        /// <summary>
        /// 接收单位
        /// </summary>
        [JsonProperty("receivingUnit")]
        public string? ReceivingUnit { get; set; }

        /// <summary>
        /// 接收人
        /// </summary>
        [JsonProperty("recipient")]
        public string? Recipient { get; set; }

        /// <summary>
        /// 接收人账号
        /// </summary>
        [JsonProperty("receiverAccount")]
        public string? ReceiverAccount { get; set; }

        /// <summary>
        /// 接收人电话
        /// </summary>
        [JsonProperty("receiverTelephone")]
        public string? ReceiverTelephone { get; set; }

        /// <summary>
        /// 接收人邮箱
        /// </summary>
        [JsonProperty("recipientEmail")]
        public string? RecipientEmail { get; set; }

        /// <summary>
        /// 文件编号
        /// </summary>
        [JsonProperty("documentNo")]
        public string? DocumentNo { get; set; }

        /// <summary>
        /// 变更后文件编号
        /// </summary>
        [JsonProperty("changeDocumentNo")]
        public string? ChangeDocumentNo { get; set; }

        /// <summary>
        /// 补充的文件编号
        /// </summary>
        [JsonProperty("supplementDocumentNo")]
        public string? SupplementDocumentNo { get; set; }

        /// <summary>
        /// 技术文件示例值-[{"uid":"20210609081952_51ef5.jpg","name":"图片.jpg","url":"https://c-ssl.duitang.com/uploads/blog/202106/09/20210609081952_51ef5.jpg\"}]
        /// </summary>
        [JsonProperty("technicalDocument")]
        public string? TechnicalDocument { get; set; }

        /// <summary>
        /// 原技术文件
        /// </summary>
        [JsonProperty("originalFile")]
        public string? OriginalFile { get; set; }

        /// <summary>
        /// 变更后技术文件
        /// </summary>
        [JsonProperty("changedTechnicalFile")]
        public string? ChangedTechnicalFile { get; set; }

        /// <summary>
        /// 变更通知单
        /// </summary>
        [JsonProperty("changeNotice")]
        public string? ChangeNotice { get; set; }

        /// <summary>
        /// 作废通知单
        /// </summary>
        [JsonProperty("invalidNotice")]
        public string? InvalidNotice { get; set; }

        /// <summary>
        /// 补充的技术文件
        /// </summary>
        [JsonProperty("supplementNotice")]
        public string? SupplementNotice { get; set; }

        /// <summary>
        /// 其他附件
        /// </summary>
        [JsonProperty("otherDocuments")]
        public string? OtherDocuments { get; set; }

        /// <summary>
        /// 会签人员:会签人工号,用英文逗号隔开拼接字符串
        /// </summary>
        [JsonProperty("jointlySign")]
        public string JointlySign { get; set; }

        /// <summary>
        /// 存档责任文件(0:否,1:是)
        /// </summary>
        [JsonProperty("filingResponsibility")]
        public string FilingResponsibility { get; set; }

        /// <summary>
        /// 是否涉及商品特定附件(0:否,1:是)
        /// </summary>
        [JsonProperty("isProductSpecific")]
        public string? IsProductSpecific { get; set; }

        /// <summary>
        /// 对象评审人员列表
        /// </summary>
        [JsonProperty("lotus_process_file_countersignList")]
        public List<LotusProcessFileCountersign> LotusProcessFileCountersignList { get; set; }
    }

    /// <summary>
    /// 技术文件信息
    /// </summary>
    public class TechnicalDocumentInfo
    {
        [JsonProperty("uid")]
        public string Uid { get; set; }

        [JsonProperty("name")]
        public string Name { get; set; }

        [JsonProperty("url")]
        public string Url { get; set; }
    }

    /// <summary>
    /// 对象评审人员
    /// </summary>
    public class LotusProcessFileCountersign 
    {
        /// <summary>
        /// 角色
        /// </summary>
        [JsonProperty("role")]
        public string? Role { get; set; }

        /// <summary>
        /// 评审结果
        /// </summary>
        [JsonProperty("reviewResults")]
        public string? ReviewResults { get; set; }

        /// <summary>
        /// 评审人员
        /// </summary>
        [JsonProperty("reviewers")]
        public string? Reviewers { get; set; }

        /// <summary>
        /// 评审时间
        /// </summary>
        [JsonProperty("reviewTime")]
        public string? ReviewTime { get; set; }
    }
}
